package com.beiding.my.query.follow.compare;

import com.beiding.my.query.ParamHolder;
import com.beiding.my.query.follow.Compare;

public class Ternary implements Compare {

    private String field;

    private String symbol;

    private Object value1;

    private String connect;

    private Object value2;

    public Ternary(String field, String symbol, Object value1, String connect, Object value2) {
        this.field = field;
        this.symbol = symbol;
        this.value1 = value1;
        this.connect = connect;
        this.value2 = value2;
    }

    @Override
    public String create(ParamHolder paramHolder) {
        return field + " " + symbol + " " + paramHolder.set(value1) + " " + connect + " " + paramHolder.set(value2);
    }
}
